<?php
include('config.php');
$type_name = isset($_POST['type_name']) ? $_POST['type_name'] : '';
$breed_name = isset($_POST['breed_name']) ? $_POST['breed_name'] : '';
$number_name = isset($_POST['number_name']) ? $_POST['number_name'] : '';
$type_id = isset($_POST['type_id']) ? $_POST['type_id'] : '';
$breed_id = isset($_POST['breed_id']) ? $_POST['breed_id'] : '';
$number_id = isset($_POST['number_id']) ? $_POST['number_id'] : '';
//首先更新类型
$type_where = " type_id={$type_id}";
$type_data = array('type_name'=>$type_name);
$mysql->update('type',$type_where,$type_data);
//更新名称
$breed_where = " breed_id = {$breed_id}";
$breed_data = array('breed_name'=>$breed_name);
$mysql->update('breed',$breed_where,$breed_data);
//更新编号
$number_where = " number_id={$number_id}";
$number_data = array('number_name'=>$number_name);
$mysql->update('number',$number_where,$number_data);
echo "1";